do you want to yet your users seach google maps on your webpage? would you like to store adders as lng and lat in you database but cant get the lat and long into a vebable then this snipit is for you

1)save each file as the name it says
2) get a google key for your site (read googlekey.php for help)
3) draw two images 100,50 pix and call them logo.png and logo_shadow.png
4)upload to your site try it out then format it the way you want it to be 

==========================================================

file name :  getLanLog.php
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
</script>
<form action="process2.php" method="post"> 
          Street Number: <input name="num" type="text" /> 
          Street Name: <input name="name" type="text" /> 
          City: <input name="city" type="text" /> 
          contry: <input name="contry" type="text" /> 

  <input type="submit" />
</form>

</body>
</html>
[/code]

File name: googlekey.php
[code]
<?php
/*
  To get a free key for your website goto google and seach for google key api and it will take you to this page
  http://code.google.com/apis/maps/signup.html
*/
    function getGooKey(){  
           
            $googleKey = 'Put your key here';
            return $googleKey;
     }
?>
[/code]

file name : headMap.php
[code]

<?PHP
$key = getGooKey();
//all the stuff google needs in betwen the <head></head> tages
echo'
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&key='.$key.'"></script>
';
?>
[/code]

file name : process2.php
[code]

<?PHP
/* side note
 $var = preg_replace("/ /","+",
 all this dose is remove any spaces and replaces with a plus sign +
*/
//street number
$num = $_POST['num'];

//name of the street
$name=preg_replace("/ /","+",$_POST['name']);

//name of the city
$city=preg_replace("/ /","+",$_POST['city']);

//name of the contry
$contry=preg_replace("/ /","+",$_POST['contry']);

//includs the getKey funcion
include('googlekey.php');

//sets your google key
$key = getGooKey('');

//this returns the data from a csv file and stors it in the homepage string
$homepage = file_get_contents('http://maps.google.com/maps/geo?q='.$num.',+'.$name.',+'.$city.',+'.$contry.'&output=csv&sensor=false&key='.$key);
//splits the data into seperate array cells
$keywords = preg_split("/[\s,]+/", "$homepage");
/* side note
      $keyWord array brake down
      $keyWord[0] returns 200 if success full at downloading the cvs data
      $keyWord[1] how close to the the target
      $keyWord[2] late
      $keyWord[3] long
*/
    

?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?PHP include('headMap.php');?>
</head>

<?PHP include('mapsettings.php');?>

<body onload="initialize()">

<?php
      if($keywords[0] == 200){
          echo 'Accuracy '.$keywords[1];
          echo'<br>';
          echo 'latitude '.$keywords[2];
          echo 'longitude '.$keywords[3];
          echo'<br>';
          echo $homepage;
    }else{echo 'failed to access sever';}
    echo'<br>';
    echo $html; 
    echo '<hr>'; 

?>

<div id="map_canvas" style="width:800px; height:500px"></div>
</body>
</html>
[/code]

file name : mapsettings.php
[code]
<?PHP
//this file dose all the work sets the format the pointers and the view 
echo'
<script type="text/javascript">
	//a function that dose all the work 
	function initialize() {
    
    //this is where you are viwing eg New zeanland or any give street this is not where the marker is put
		var latlng = new google.maps.LatLng('.$keywords[2].','.$keywords[3].');
		
		var settings = {
			zoom: 15,
			center: latlng,
			mapTypeControl: true,
			mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
			navigationControl: true,
			navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
			mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      
    var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
    
    //this is where you display content when a usere clicks a marker
    var contentString = \'<div id="content">\'+
    \'<div id="siteNotice">\'+
    \'</div>\'+
    \'<h1 id="firstHeading" class="firstHeading">Chaos386</h1>\'+
    \'<div id="bodyContent">\'+
    \'<p>What ever you want to say </p>\'+
    \'</div>\'+
    \'</div>\';
 
var infowindow = new google.maps.InfoWindow({
    content: contentString
}); 
  
    
    //custom markers ya you can change the size to fit your pic
    var companyLogo = new google.maps.MarkerImage(\'logo.png\',
                      new google.maps.Size(100,50),
                      new google.maps.Point(0,0),
                      new google.maps.Point(50,50)
    );
    //cutsom shadow 
    var companyShadow = new google.maps.MarkerImage(\'logo_shadow.png\',
                        new google.maps.Size(130,50),
                        new google.maps.Point(0,0),
                        new google.maps.Point(65, 50)
);

    
    
        //this is where your marker is find eg. 123 frake st you can hard code this or put it from a dataBace
        var companyPos = new google.maps.LatLng('.$keywords[2].','.$keywords[3].');
        var companyMarker = new google.maps.Marker({
        position: companyPos,
        map: map,
        icon: companyLogo,
        shadow: companyShadow,
        title:"test map",
        zIndex: 4
});
google.maps.event.addListener(companyMarker, \'click\', function() {
  infowindow.open(map,companyMarker);
});
}
</script>
';
?>
[/code]